package mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import pojo.Book;
import pojo.Place;
import pojo.vo.BookVo;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-12-05
 * Time: 14:45
 */
@Mapper
public interface BookMapper {
    /**
     * 查询所有书籍
     */
    public List<BookVo> listBook();

    /**
     * 添加书籍
     */
    public boolean addBook(@Param("name") String name,
                           @Param("author")String author,
                           @Param("press")String press,
                           @Param("surplusNumber")Long surplusNumber,
                           @Param("allNumber") Long allNumber,
                           @Param("storagePlace") Long storagePlace);

    /**
     * 根据书籍条件进行删除
     * @param bookId
     * @param
     * @return
     */
    boolean deleteBook1(@Param("bookId") Long bookId);

    boolean deleteBook2( @Param("name")String name);

    /**
     * 根据书名进行模糊查询
     * @param name
     * @return
     */
    List<BookVo> listBookByBookName(@Param("name")String name);

    /**
     * 根据书名进行精确查询
     * @param name
     * @return
     */
    Book getBookByName(String name);
    /**
     * 根据书id进行精确查询
     */
    List<BookVo> listBookByBookId(@Param("id") Long id);

    /**
     * 修改书籍
     */
    boolean modifyBook(@Param("newbook") Book newbook, @Param("rawBookId") Long rawBookId);

}
